package com.kenliang.toolslib.rxjava;

import io.reactivex.Observable;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

/**
 * @author KenLiang
 * @description:
 * @date Created in 7:07 PM 2019/4/27.
 */
public class RxJava {


    public static void main(String[] args) {
        Arrays.stream("hello".split("")).forEach((x)->{
            System.out.println(x);
        });
        Arrays.asList("hello".split("")).forEach((x)->{
            System.out.println(x);
        });
    }

    @Test
    public void testCreateOperator() {
        Observable<String> o = Observable.just("a", "b", "c");
        o.subscribe((x)->{
            System.out.println("onNext:"+x);
        },(e)->{
            System.out.println("onError");
        },()->{
            System.out.println("onComplete");
        });
    }
}
